https://github.com/usrme/protohackers
Protohackers server programming challenge answers
https://github.com/usrme/protohackers
Last synced: 12 months ago
JSON representation
Protohackers server programming challenge answers
- Host: GitHub
- URL: https://github.com/usrme/protohackers
- Owner: usrme
- License: mit
- Created: 2025-06-24T16:40:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-24T17:36:49.000Z (about 1 year ago)
- Last Synced: 2025-06-24T18:42:24.448Z (about 1 year ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# protohackers
[Protohackers](https://protohackers.com/) server programming challenge answers.
## Deployment
- install ['flyctl'](https://fly.io/docs/flyctl/);
- authenticate;
- navigate to the root of the repository;
- allocate dedicated IPv4 address (costs $2/mo): `flyctl ips allocate-v4 --app `;
- without this it is not possible to connect over just TCP, even if an IPv6 address is allocated;
- [here's](https://www.tigrisdata.com/blog/docker-registry-at-home/) a blog post over at [Tigris](https://tigrisdata.com) that gives away $50 in credits;
- more information about this requirement [here](https://community.fly.io/t/tcp-and-udp-service-ports-dont-work/9746) and [here](https://community.fly.io/t/announcement-shared-anycast-ipv4/9384/25);
- deploy: `flyctl deploy --dockerfile Dockerfile. --ha=false`;
- see problem names under `cmd/` directory and [here](https://protohackers.com/problems).
> [!important]
> Any uncommitted changes will also be deployed.
## Testing
### Locally
- move to problem directory: `pushd cmd//`
- run tests:
```console
go test -v
=== RUN TestProblem
--- PASS: TestProblem (0.00s)
PASS
ok github.com/usrme/protohackers/cmd/ 3.138s
```
- move back to the root of the repository: `popd`;
- build image: `docker build --tag -f Dockerfile. .`;
- run container: `docker run -p 5000:5000 `;
- pass command:
```console
$ echo "hello world" | nc -w1 localhost 5000
hello world
```
### Remotely
- [deploy](#deployment);
- pass command:
```console
$ echo "hello world" | nc -w1 .fly.dev 5000
hello world
```