-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Trajan0x <[email protected]>
- Loading branch information
Showing
64 changed files
with
31,786 additions
and
7,527 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Treat all Go files in this repo as binary, with no git magic updating | ||
# line endings. Windows users contributing to Go will need to use a | ||
# modern version of git and editors capable of LF line endings. | ||
|
||
*.go -text diff=golang | ||
|
||
# don't count abigen files in linguist as go | ||
*.abigen.go linguist-vendored | ||
# ignore multicopier files | ||
*_gen.go linguist-vendored | ||
|
||
# svg should be treated as a binary https://git.io/JE2VK | ||
*.svg binary |
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 |
---|---|---|
|
@@ -13,3 +13,6 @@ M-contracts: | |
|
||
C-Protocol-Critical: | ||
- 'packages/contracts/**/*.sol' | ||
|
||
Go: | ||
- '**/*.go' |
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,23 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
], | ||
"assignees": [], | ||
"enabledManagers": ["gomod"], | ||
"packageRules": [ | ||
{ | ||
"matchUpdateTypes": ["minor", "patch", "pin", "digest"], | ||
"excludePackagePrefixes": [], | ||
"matchManagers": ["gomod"], | ||
"automerge": true, | ||
"postUpdateOptions": [ | ||
"gomodTidy" | ||
] | ||
} | ||
], | ||
"branchConcurrentLimit": 10, | ||
"prConcurrentLimit": 10, | ||
"git-submodules": { | ||
"enabled": true | ||
} | ||
} |
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,13 @@ | ||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 30 | ||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: false | ||
# Label to use when marking an issue as stale | ||
staleLabel: stale | ||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false |
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,129 @@ | ||
name: Go Workflows | ||
on: | ||
pull_request: | ||
push: | ||
branches-ignore: | ||
- 'gh-pages' | ||
|
||
|
||
jobs: | ||
# make sure the build works | ||
build: | ||
name: Build | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
matrix: | ||
go-version: | ||
- 1.18.x | ||
platform: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: authenticate with github for private go modules | ||
uses: fusion-engineering/setup-git-credentials@v2 | ||
with: | ||
credentials: https://0xnero:${{secrets.GIT_TOKEN }}@github.com/ | ||
- name: Go modules cache | ||
uses: actions/cache@v2 | ||
with: | ||
# see https://github.com/mvdan/github-actions-golang | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Build | ||
# go build all workspaces | ||
run: go build $(go work edit -json | jq -c -r '[.Use[].DiskPath] | map_values(. + "/...")[]') | ||
|
||
test: | ||
name: Test | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
matrix: | ||
go-version: | ||
- 1.18.x | ||
platform: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
|
||
- name: Go modules cache | ||
uses: actions/cache@v2 | ||
with: | ||
# see https://github.com/mvdan/github-actions-golang | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: authenticate with github for private go modules | ||
uses: fusion-engineering/setup-git-credentials@v2 | ||
with: | ||
credentials: https://trajan0x:${{secrets.GIT_TOKEN }}@github.com/ | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Test | ||
run: go test $(go work edit -json | jq -c -r '[.Use[].DiskPath] | map_values(. + "/...")[]') -coverprofile=profile.cov | ||
|
||
- name: Send coverage | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
path-to-profile: profile.cov | ||
|
||
#note: right now this is not run against all work dirs | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
|
||
- name: authenticate with github for private go modules | ||
uses: fusion-engineering/setup-git-credentials@v2 | ||
with: | ||
credentials: https://0xnero:${{secrets.GIT_TOKEN }}@github.com/ | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
working-directory: core/ | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: v1.46.2 | ||
# Path to your GolangCI-Lint config within the repo (optional) | ||
config: .golangci.yml | ||
# see: https://github.com/golangci/golangci-lint/issues/2654 | ||
env: | ||
# GitHub token for annotations (optional) | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# see: https://github.com/golangci/golangci-lint/issues/337#issuecomment-510136513 | ||
GOGC: 20 | ||
GOPRIVATE: "GOPRIVATE=github.com/synapsecns/synapse-node" |
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 |
---|---|---|
@@ -1,2 +1,53 @@ | ||
# sanguine | ||
Implementation of the Sanguine messaging standard | ||
# Sanguine | ||
|
||
[![Go Workflows](https://github.com/synapsecns/sanguine/actions/workflows/go.yml/badge.svg)](https://github.com/synapsecns/sanguine/actions/workflows/go.yml) | ||
[![Foundry Tests](https://github.com/synapsecns/sanguine/actions/workflows/foundry-tests.yml/badge.svg)](https://github.com/synapsecns/sanguine/actions/workflows/foundry-tests.yml) | ||
|
||
|
||
## Contributing | ||
|
||
Read through [CONTRIBUTING.md](./CONTRIBUTING.md) for a general overview of our contribution process. | ||
Then check out our list of [good first issues](https://github.com/ethereum-optimism/optimism/contribute) to find something fun to work on! | ||
|
||
## Directory Structure | ||
|
||
<pre> | ||
root | ||
├── <a href="./packages">packages</a> | ||
│ ├── <a href="./packages/contracts">contracts</a>: Contracts used for synapse | ||
|
||
├── <a href="./core">core</a>: Core service contains the code used by different agents | ||
</pre> | ||
|
||
|
||
## Setup | ||
|
||
Clone the repository, open it, and install nodejs packages with `yarn`: | ||
|
||
```bash | ||
git clone https://github.com/synapsecns/sanguine | ||
cd sanguine | ||
yarn install | ||
``` | ||
|
||
|
||
### Install the Correct Version of NodeJS | ||
|
||
Using `nvm`, install the correct version of NodeJS. | ||
|
||
``` | ||
nvm use | ||
``` | ||
|
||
### Building the TypeScript packages | ||
|
||
To build all of the [TypeScript packages](./packages), run: | ||
|
||
```bash | ||
yarn clean | ||
yarn build | ||
``` | ||
|
||
Packages compiled when on one branch may not be compatible with packages on a different branch. | ||
**You should recompile all packages whenever you move from one branch to another.** | ||
Use the above commands to recompile the packages. |
Oops, something went wrong.