forked from wormhole-foundation/wormhole
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stub out algorand support in wormhole (wormhole-foundation#611)
* Stub out algorand support in wormhole 1) Introduce the algorand chain constant in all the appropriate places 2) Deploy pyth/hernandc algorand smart contracts into devnet 3) Fund all the correct contracts for devnet testing Change-Id: I6e4402b5b21223b32ea89653f8c7606f5c7f2843 * pr/jsiegel/algorand-v1: ALGORAND is not a EVM chain @ gusc1a-ossdev-jsl1 * pr/jsiegel/algorand-v1: fix lint @ gusc1a-ossdev-jsl1 * pr/jsiegel/algorand-v1: put the requirements into the image @ gusc1a-ossdev-jsl1 * jsiegel/algorand: make the watcher hang forever @ gusc1a-ossdev-jsl1 * jsiegel/algorand: comment these out @ gusc1a-ossdev-jsl1 * jsiegel/algorand: put this back in @ gusc1a-ossdev-jsl1 * jsiegel/algorand: fix guardian example @ gusc1a-ossdev-jsl1 * Generate teal source code commit-id:a537a109 * jsiegel/algorand: it builds @ gusc1a-ossdev-jsl1 * pr/jsiegel/algorand-v1: add Dockerfile.teal @ gusc1a-ossdev-jsl1 * jsiegel/algorand: improve the dependencies @ gusc1a-ossdev-jsl1 * pr/jsiegel/algorand-v1: Fix up build @ gusc1a-ossdev-jsl1 * dead file * pr/jsiegel/algorand-v1: remove more stuff @ gusc1a-ossdev-jsl1 * pr/jsiegel/algorand-v1: fix build @ gusc1a-ossdev-jsl1 * pr/jsiegel/algorand-v1: freeze the requirements @ gusc1a-ossdev-jsl1 * pr/jsiegel/algorand-v1: Fix teal to use pipenv @ gusc1a-ossdev-jsl1 * pr/jsiegel/algorand-v1: fix miss-merge @ gusc1a-ossdev-jsl1 Co-authored-by: Leo <[email protected]>
- Loading branch information
1 parent
d6945bf
commit f90ed66
Showing
19 changed files
with
711 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 | ||
FROM docker.io/fedora:34 AS teal-build | ||
RUN dnf -y install python3-pip | ||
|
||
COPY staging/algorand/teal /teal | ||
|
||
# Install pyTEAL dependencies | ||
COPY third_party/algorand/Pipfile.lock Pipfile.lock | ||
COPY third_party/algorand/Pipfile Pipfile | ||
|
||
RUN pip install pipenv | ||
RUN pipenv install | ||
|
||
# Regenerate TEAL assembly | ||
RUN pipenv run python3 /teal/wormhole/pyteal/vaa-processor.py vaa-processor-approval.teal vaa-processor-clear.teal | ||
RUN pipenv run python3 /teal/wormhole/pyteal/vaa-verify.py 0 vaa-verify.teal | ||
|
||
FROM scratch AS teal-export | ||
COPY --from=teal-build /vaa-processor-approval.teal third_party/algorand/teal/ | ||
COPY --from=teal-build /vaa-processor-clear.teal third_party/algorand/teal/ | ||
COPY --from=teal-build /vaa-verify.teal third_party/algorand/teal/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package algorand | ||
|
||
import ( | ||
"context" | ||
"github.com/certusone/wormhole/node/pkg/common" | ||
"github.com/certusone/wormhole/node/pkg/readiness" | ||
) | ||
|
||
type ( | ||
// Watcher is responsible for looking over Algorand blockchain and reporting new transactions to the contract | ||
Watcher struct { | ||
urlRPC string | ||
urlToken string | ||
contract string | ||
|
||
msgChan chan *common.MessagePublication | ||
setChan chan *common.GuardianSet | ||
} | ||
) | ||
|
||
// NewWatcher creates a new Algorand contract watcher | ||
func NewWatcher(urlRPC string, urlToken string, contract string, lockEvents chan *common.MessagePublication, setEvents chan *common.GuardianSet) *Watcher { | ||
return &Watcher{urlRPC: urlRPC, urlToken: urlToken, contract: contract, msgChan: lockEvents, setChan: setEvents} | ||
} | ||
|
||
func (e *Watcher) Run(ctx context.Context) error { | ||
readiness.SetReady(common.ReadinessAlgorandSyncing) | ||
|
||
select {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Generated | ||
teal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
py-algorand-sdk = "*" | ||
pyteal = "*" | ||
mypy = "*" | ||
pytest = "*" | ||
|
||
[dev-packages] |
Oops, something went wrong.