Skip to content

Commit

Permalink
Initial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WlinkNET committed Dec 20, 2024
1 parent 1933d89 commit 6fe7027
Show file tree
Hide file tree
Showing 266 changed files with 878 additions and 1,025 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ jobs:
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "./build/sonicd,./build/sonictool"
artifacts: "./build/xpensed,./build/xpensetool"
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: go
go:
- 1.14.x

go_import_path: github.com/Fantom-foundation/go-opera
go_import_path: github.com/WlinkNET/xpense_chain

cache:
directories:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Example of usage:
# docker build -t sonic .
# docker run --name sonic1 --entrypoint sonictool sonic --datadir=/var/sonic genesis fake 1
# docker run --name sonic1 --entrypoint xpensetool sonic --datadir=/var/sonic genesis fake 1
# docker run --volumes-from sonic1 -p 5050:5050 -p 5050:5050/udp -p 18545:18545 sonic --fakenet 1/1 --http --http.addr=0.0.0.0

FROM golang:1.22 as builder
Expand All @@ -19,11 +19,11 @@ RUN make all

FROM golang:1.22

COPY --from=builder /go/Sonic/build/sonicd /usr/local/bin/
COPY --from=builder /go/Sonic/build/sonictool /usr/local/bin/
COPY --from=builder /go/Sonic/build/xpensed /usr/local/bin/
COPY --from=builder /go/Sonic/build/xpensetool /usr/local/bin/

EXPOSE 18545 18546 5050 5050/udp

VOLUME /var/sonic

ENTRYPOINT ["sonicd", "--datadir=/var/sonic"]
ENTRYPOINT ["xpensed", "--datadir=/var/sonic"]
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
.PHONY: all
all: sonicd sonictool
all: xpensed xpensetool

GOPROXY ?= "https://proxy.golang.org,direct"
.PHONY: sonicd sonictool
sonicd:
.PHONY: xpensed xpensetool
xpensed:
GIT_COMMIT=`git rev-list -1 HEAD 2>/dev/null || echo ""` && \
GIT_DATE=`git log -1 --date=short --pretty=format:%ct 2>/dev/null || echo ""` && \
GOPROXY=$(GOPROXY) \
go build \
-ldflags "-s -w -X github.com/Fantom-foundation/go-opera/config.GitCommit=$${GIT_COMMIT} -X github.com/Fantom-foundation/go-opera/config.GitDate=$${GIT_DATE}" \
-o build/sonicd \
./cmd/sonicd
-ldflags "-s -w -X github.com/WlinkNET/xpense_chain/config.GitCommit=$${GIT_COMMIT} -X github.com/WlinkNET/xpense_chain/config.GitDate=$${GIT_DATE}" \
-o build/xpensed \
./cmd/xpensed

sonictool:
xpensetool:
GIT_COMMIT=`git rev-list -1 HEAD 2>/dev/null || echo ""` && \
GIT_DATE=`git log -1 --date=short --pretty=format:%ct 2>/dev/null || echo ""` && \
GOPROXY=$(GOPROXY) \
go build \
-ldflags "-s -w -X github.com/Fantom-foundation/go-opera/config.GitCommit=$${GIT_COMMIT} -X github.com/Fantom-foundation/go-opera/config.GitDate=$${GIT_DATE}" \
-o build/sonictool \
./cmd/sonictool
-ldflags "-s -w -X github.com/WlinkNET/xpense_chain/config.GitCommit=$${GIT_COMMIT} -X github.com/WlinkNET/xpense_chain/config.GitDate=$${GIT_DATE}" \
-o build/xpensetool \
./cmd/xpensetool

TAG ?= "latest"
.PHONY: sonic-image
sonic-image:
.PHONY: xpense-image
xpense-image:
docker build \
--network=host \
-f ./docker/Dockerfile.opera -t "sonic:$(TAG)" .
-f ./docker/Dockerfile.opera -t "xpense:$(TAG)" .

.PHONY: test
test:
Expand Down
4 changes: 2 additions & 2 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Please check if what you want to add to `go-opera` list meets [quality standards](https://github.com/Fantom-foundation/go-opera/blob/master/CONTRIBUTING.md#quality-standard) before sending pull request.
Please check if what you want to add to `go-opera` list meets [quality standards](https://github.com/WlinkNET/xpense_chain/blob/master/CONTRIBUTING.md#quality-standard) before sending pull request.

**Please provide package links to:**

Expand All @@ -14,4 +14,4 @@ Please check if what you want to add to `go-opera` list meets [quality standards
- [ ] I have added godoc link to the repo and to my pull request.
- [ ] I have added coverage service link to the repo and to my pull request.
- [ ] I have added goreportcard link to the repo and to my pull request.
- [ ] I have read [Contribution guidelines](https://github.com/Fantom-foundation/go-opera/blob/master/CONTRIBUTING.md#contribution-guidelines), [maintainers note](https://github.com/Fantom-foundation/go-opera/blob/master/CONTRIBUTING.md#maintainers) and [Quality standard](https://github.com/Fantom-foundation/go-opera/blob/master/CONTRIBUTING.md#quality-standard).
- [ ] I have read [Contribution guidelines](https://github.com/WlinkNET/xpense_chain/blob/master/CONTRIBUTING.md#contribution-guidelines), [maintainers note](https://github.com/WlinkNET/xpense_chain/blob/master/CONTRIBUTING.md#maintainers) and [Quality standard](https://github.com/WlinkNET/xpense_chain/blob/master/CONTRIBUTING.md#quality-standard).
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,62 @@ them using your favourite package manager. Once the dependencies are installed,
```shell
make all
```
The build output are ```build/sonicd``` and ```build/sonictool``` executables.
The build output are ```build/xpensed``` and ```build/xpensetool``` executables.

## Initialization of the Sonic Database

You will need a genesis file to join a network. Please check the following
site for details how to get one: https://github.com/Fantom-foundation/lachesis_launch
Once you obtain the most recent genesis file available, you need to use the `sonictool`
Once you obtain the most recent genesis file available, you need to use the `xpensetool`
create a starting DB.

```shell
sonictool --datadir=<target DB path> genesis <path to the genesis file>
xpensetool --datadir=<target DB path> genesis <path to the genesis file>
```

## Running `sonicd`
## Running `xpensed`

Going through all the possible command line flags is out of scope here,
but we've enumerated a few common parameter combos to get you up to speed quickly
on how you can run your own `sonicd` instance.
on how you can run your own `xpensed` instance.

### Launching a network

Launching `sonicd` readonly (non-validator) node for network specified by the genesis file:
Launching `xpensed` readonly (non-validator) node for network specified by the genesis file:

```shell
sonicd --datadir=<DB path>
xpensed --datadir=<DB path>
```

### Configuration

As an alternative to passing the numerous flags to the `sonicd` binary, you can also pass a
As an alternative to passing the numerous flags to the `xpensed` binary, you can also pass a
configuration file via:

```shell
sonicd --datadir=<DB path> --config /path/to/your/config.toml
xpensed --datadir=<DB path> --config /path/to/your/config.toml
```

To get an idea how the file should look like you can use the `dumpconfig` subcommand to
export the default configuration:

```shell
sonictool --datadir=<DB path> dumpconfig
xpensetool --datadir=<DB path> dumpconfig
```

### Validator

New validator private key may be created with `sonictool --datadir=<DB path> validator new` command.
New validator private key may be created with `xpensetool --datadir=<DB path> validator new` command.

To launch a validator, you have to use `--validator.id` and `--validator.pubkey` flags to enable
events emitter. Check the [Fantom Documentation](https://docs.fantom.foundation) for the detailed process
of obtaining the validator ID and registering your initial stake.

```shell
sonicd --datadir=<DB path> --validator.id=YOUR_ID --validator.pubkey=0xYOUR_PUBKEY
xpensed --datadir=<DB path> --validator.id=YOUR_ID --validator.pubkey=0xYOUR_PUBKEY
```

`sonicd` will prompt you for a password to decrypt your validator private key. Optionally, you can
`xpensed` will prompt you for a password to decrypt your validator private key. Optionally, you can
specify password with a file using `--validator.password` flag.

#### Participation in discovery
Expand All @@ -74,6 +74,6 @@ Optionally you can specify your public IP to straighten connectivity of the netw
Ensure your TCP/UDP p2p port (5050 by default) isn't blocked by your firewall.

```shell
sonicd --datadir=<DB path> --nat=extip:1.2.3.4
xpensed --datadir=<DB path> --nat=extip:1.2.3.4
```

Loading

0 comments on commit 6fe7027

Please sign in to comment.