Skip to content

Commit

Permalink
Add types and docker
Browse files Browse the repository at this point in the history
  • Loading branch information
schnetzlerjoe committed Jan 31, 2024
1 parent 1781b38 commit e1ca6e6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use a base image with Node.js since Agoric SDK is Node.js based
FROM node:18

RUN apt-get update && apt-get install -y curl make build-essential jq

# Install Go
ENV GO_VERSION 1.20.13
RUN curl -OL https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz \
&& rm go${GO_VERSION}.linux-amd64.tar.gz
ENV PATH $PATH:/usr/local/go/bin

# Clone the Agoric SDK repository
WORKDIR /agoric-sdk
COPY . .

# Install Agoric SDK dependencies
RUN yarn install && yarn build

# Expose necessary ports
EXPOSE 8000 8000

# Start the Agoric blockchain and ag-solo
# You might need to use a script to start these services as they likely need to run in parallel
COPY start-agoric.sh .
RUN chmod +x start-agoric.sh
CMD ["./start-agoric.sh"]
23 changes: 23 additions & 0 deletions packages/pegasus/src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,26 @@
* @typedef {object} SenderOptions
* @property {string} [sender] the sender address attached to the packet to receive any refund
*/

/**
* @typedef {Object} PFMTransfer
* @property {string} receiver - The receiver's account identifier.
* @property {string} port - The port being used.
* @property {string} channel - The communication channel identifier.
* @property {number} retries - Number of retries allowed.
* @property {string} next - Next memo to append to the transfer.
*/

/**
* @typedef {Object} PFMCall
* @property {string} address - The address of the contract.
* @property {string} contractKey - The key of the contract.
* @property {string} functionName - The function to be called on the contract.
* @property {string} args - The arguments for the function call, in JSON string format.
*/

/**
* @typedef {Object} Forward
* @property {PFMTransfer} [transfer] - Details of the transfer PFM operation.
* @property {PFMCall} [call] - Details of the PFM contract call operation.
*/
5 changes: 5 additions & 0 deletions start-agoric.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

cd /agoric-sdk/packages/cosmic-swingset
make scenario2-setup
make scenario2-run-chain-economy

0 comments on commit e1ca6e6

Please sign in to comment.